/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogResultInfo.java
 *
 * Created on 18/05/2011, 17:55:32
 */

package gui;

import main.entities.ExecutionInfo;

/**
 *
 * @author alexanderdealmeidapinto
 */
public class JDialogResultInfo extends javax.swing.JDialog {

    /** Creates new form JDialogResultInfo */
    public JDialogResultInfo(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    public void configure(ExecutionInfo executionInfo){
        jLabelInstanceName.setText(executionInfo.getInstanceName());
        jLabelNumberFlights.setText(executionInfo.getNumberOfFlights() + "");
        jLabelObjectiveFunctionValue.setText(executionInfo.getObjectiveFunctionValue() + "");
        jLabelExecutionTime.setText(executionInfo.getExecutionTime() + "");
        jLabelNumberOfTrack.setText(executionInfo.getNumberOfTracks() + "");
        jLabelTotalDelay.setText(executionInfo.getTotalDelayed() + "");
        jLabelMaxDelay.setText(executionInfo.getMaxDelayed() + "");
        jLabelNumberOfDelayFlights.setText(executionInfo.getNumberOfDelayedFlights() + "");
        jLabelNumberOfRepositionFlights.setText(executionInfo.getNumberOfRepositions() + "");

        validate();
    }



    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel8 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabelInstanceName = new javax.swing.JLabel();
        jLabelNumberFlights = new javax.swing.JLabel();
        jLabelObjectiveFunctionValue = new javax.swing.JLabel();
        jLabelExecutionTime = new javax.swing.JLabel();
        jLabelNumberOfTrack = new javax.swing.JLabel();
        jLabelTotalDelay = new javax.swing.JLabel();
        jLabelMaxDelay = new javax.swing.JLabel();
        jLabelNumberOfDelayFlights = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabelNumberOfRepositionFlights = new javax.swing.JLabel();

        jLabel8.setText("Número de reposicionamentos:");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel1.setText("Nome da Instância:");

        jLabel2.setText("Valor da Função Objetivo:");

        jLabel3.setText("Tempo de Execução:");

        jLabel4.setText("Atraso total:");

        jLabel5.setText("Maior Atraso:");

        jLabel6.setText("Número de voos com atraso:");

        jLabel7.setText("Número de trilhos:");

        jLabel9.setText("Número de voos:");

        jLabelInstanceName.setText("jLabel10");

        jLabelNumberFlights.setText("jLabel11");

        jLabelObjectiveFunctionValue.setText("jLabel13");

        jLabelExecutionTime.setText("jLabel12");

        jLabelNumberOfTrack.setText("jLabel14");

        jLabelTotalDelay.setText("jLabel15");

        jLabelMaxDelay.setText("jLabel16");

        jLabelNumberOfDelayFlights.setText("jLabel17");

        jLabel10.setText("Número de reposicionamentos:");

        jLabelNumberOfRepositionFlights.setText("jLabel18");

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel10)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel9)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel7)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel4)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel3)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel6)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel5))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabelNumberFlights)
                    .add(jLabelObjectiveFunctionValue)
                    .add(jLabelExecutionTime)
                    .add(jLabelNumberOfTrack)
                    .add(jLabelTotalDelay)
                    .add(jLabelMaxDelay)
                    .add(jLabelNumberOfDelayFlights)
                    .add(jLabelInstanceName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 145, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabelNumberOfRepositionFlights))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(new java.awt.Component[] {jLabelExecutionTime, jLabelInstanceName, jLabelMaxDelay, jLabelNumberFlights, jLabelNumberOfDelayFlights, jLabelNumberOfRepositionFlights, jLabelNumberOfTrack, jLabelObjectiveFunctionValue, jLabelTotalDelay}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(jLabelInstanceName))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel9)
                    .add(jLabelNumberFlights))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(jLabelObjectiveFunctionValue))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel3)
                    .add(jLabelExecutionTime))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel7)
                    .add(jLabelNumberOfTrack))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel4)
                    .add(jLabelTotalDelay))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel5)
                    .add(jLabelMaxDelay))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel6)
                    .add(jLabelNumberOfDelayFlights))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel10)
                    .add(jLabelNumberOfRepositionFlights))
                .addContainerGap(24, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JDialogResultInfo dialog = new JDialogResultInfo(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelExecutionTime;
    private javax.swing.JLabel jLabelInstanceName;
    private javax.swing.JLabel jLabelMaxDelay;
    private javax.swing.JLabel jLabelNumberFlights;
    private javax.swing.JLabel jLabelNumberOfDelayFlights;
    private javax.swing.JLabel jLabelNumberOfRepositionFlights;
    private javax.swing.JLabel jLabelNumberOfTrack;
    private javax.swing.JLabel jLabelObjectiveFunctionValue;
    private javax.swing.JLabel jLabelTotalDelay;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

}
